<?php

require_once (dirname(__FILE__)."/class.skype4web.php");

$hs = new httpSkype;

if (!isset ($_POST['action'])) {

?>
<html>
    <head>
        <title>Extended Example Skype4Web</title>
        <link rel="stylesheet" href="skype4web.css" type="text/css" />
    </head>
    <body>
        <h1>Extended Example Skype4Web</h1>
        <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
            <label for="id">Skype ID</label>
            <input type="text" name="id" />
            <br />
            <label for="format">Format</label>
            <select name="format">
                <option value="">Default</option>
<?php

    foreach ($hs->getFormats () as $key => $value) {

?>
                <option value="<?php echo $key; ?>"><?php echo $value; ?></option>
<?php

    }

?>
            </select>
            <br />
            <label for="image">Image</label>
            <select name="image">
                <option value="">Default</option>
<?php

    foreach ($hs->getImages () as $key => $value) {

?>
                <option value="<?php echo $key; ?>"><?php echo $value; ?></option>
<?php

    }

?>
            </select>
            <br />
            <label for="lang">Language</label>
            <select name="lang">
                <option value="">Default</option>
<?php

    foreach ($hs->getLangs () as $key => $value) {

?>
                <option value="<?php echo $key; ?>"><?php echo $value; ?></option>
<?php

    }

?>
            </select>
            <br />
            <br />
            <input type="submit" name="action" />
        </form>
    </body>
</html>
<?php

}
else {
    $hs->set ($_POST);
    $hs->repr ();
}

?>
